package com.sharker.myproject.commom.config.mybatis;

import org.springframework.context.annotation.Bean;

import tk.mybatis.spring.mapper.MapperScannerConfigurer;

/**
 * MyBatis扫描接口
 * 
 * @author sharker
 * @since 2016-12-19 14:46
 */
//@Configuration
// 注意，由于MapperScannerConfigurer执行的比较早，所以必须有下面的注解
//@AutoConfigureAfter(MyBatisConfig.class)
public class MyBatisMapperScannerConfig {

	@Bean
	public MapperScannerConfigurer mapperScannerConfigurer() {
		MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
		mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
		mapperScannerConfigurer.setBasePackage("com.sharker.myproject.domain");
		return mapperScannerConfigurer;
	}

	
}
